<%@ page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@page import="com.ufida.ebscg.comm.session.UserBean"%>


<html>

	<head>
		<title>报价信息上传</title>
	</head>
	
	<body>
		
		<div style="width:100%; margin-top:35px" align="center">
		<form action="uploadfile.do" name="constratform" id="constratform" method="post" enctype="MULTIPART/FORM-DATA">

			<div align="center">
				<input type="hidden" name = "type" value = "5"/>
				<input type="hidden" name="pk_xy_proj_main" value="<%=request.getParameter("pk_xy_proj_main")%>" />
				
				
				<input type="file" name="pricefile"  id="pricefile" />
				<span>&nbsp;</span>
				<span>&nbsp;</span>
				<span>&nbsp;</span>
				<input type="button" onclick="checkFile()"  value="提 交" />
			</div>
			
			
		</form>
		
		</div>
		
		
		<div style="font-weight:bold;font-size:8pt;color:red" align="center" id="errormsg" >
		</div>
		
		<script type="text/javascript">

			function checkFile(){
				var errorMsg = document.getElementById("errormsg");
				errorMsg.innerHTML = "";
				var filePath = document.getElementById("pricefile").value;
				if(filePath != ""){
					 var filetype = filePath.substring(filePath.lastIndexOf(".")+1,filePath.length);
					 if(filetype == "xls" || filetype == "xlsx"){
						 document.getElementById("constratform").submit();
					 }else{
						 errorMsg.innerHTML = "请选择EXCEL文件上传!";
					 }
				}else{

					 errorMsg.innerHTML = "请选择EXCEL文件上传!";
				}
			}
		</script>
	</body>
	
	
</html>